using SqlSugar;
using System;

namespace CoreShop.Model
{
    /// <summary>
    /// 用户余额表(充值明细表)
    /// </summary>
    [SugarTable("corecmsuserbalance", TableDescription = "用户余额表")]
    public partial class corecmsuserbalance
    {
        /// <summary>
        /// 用户id
        /// </summary>
        [SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true)]
        public Int64 id { get; set; }
        /// <summary>
        /// 订单编号
        /// </summary>
        [SugarColumn(ColumnName = "orderId", IsNullable = true)]
        public System.String orderId { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        [SugarColumn(ColumnName = "userId")]
        public long userId { get; set; }

        /// <summary>
        /// 类型(详见UserBalanceSourceTypes,
        /// </summary>
        [SugarColumn(ColumnName = "type")]
        public System.Int32 type { get; set; }

        /// <summary>
        /// 门店id
        /// </summary>
        [SugarColumn(ColumnName = "storeId")]
        public System.Int64 storeId { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        [SugarColumn(ColumnName = "money", DecimalDigits = 2)]
        public System.Decimal money { get; set; }

        /// <summary>
        /// 赠送金额
        /// </summary>
        [SugarColumn(ColumnName = "giftAmount", DecimalDigits = 2)]
        public System.Decimal giftAmount { get; set; }

        /// <summary>
        /// 资金方向，正负1,
        /// </summary>
        [SugarColumn(ColumnName = "direction")]
        public System.Int32 direction { get; set; }

        /// <summary>
        /// 消费后余额
        /// </summary>
        [SugarColumn(ColumnName = "balance", DecimalDigits = 2)]
        public System.Decimal balance { get; set; }

        /// <summary>
        /// 消费后赠送余额
        /// </summary>
        [SugarColumn(ColumnName = "giftBalance", DecimalDigits = 2)]
        public System.Decimal giftBalance { get; set; } = 0;

        /// <summary>
        /// 资源id
        /// </summary>
        [SugarColumn(ColumnName = "sourceId", IsNullable = true)]
        public System.Int64 sourceId { get; set; }

        /// <summary>
        /// 班次id
        /// </summary>
        [SugarColumn(ColumnName = "classId", IsNullable = true)]
        public System.Int64 classId { get; set; }
        

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnName = "memo", IsNullable = true)]
        public System.String memo { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "createTime")]
        public System.DateTime createTime { get; set; }

        /// <summary>
        /// 总店Id 
        /// </summary>
        [SugarColumn(ColumnName = "corpId")]
        public System.Int32 corpId { get; set; }


        /// <summary>
        /// 项目Id
        /// </summary>
        [SugarColumn(ColumnName = "cardItemId")]
        public System.Int32 cardItemId { get; set; }

        /// <summary>
        /// 卡项数量
        /// </summary>
        [SugarColumn(ColumnName = "quantity")]
        public System.Int32 quantity { get; set; }

        /// <summary>
        /// 卡项结存
        /// </summary>
        [SugarColumn(ColumnName = "balanceQuantity")]
        public System.Int32 balanceQuantity { get; set; }

        /// <summary>
        /// 操作员Id
        /// </summary>
        [SugarColumn(ColumnName = "sysUserId")]
        public long sysUserId { get; set; }


        /// <summary>
        /// 支付方式id
        /// </summary>
        [SugarColumn(ColumnName = "paymentId")]
        public System.Int32 paymentId { get; set; }

        /// <summary>
        /// 支付单号
        /// </summary>
        [SugarColumn(ColumnName = "paymentCode")]
        public System.String paymentCode { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        [SugarColumn(ColumnName = "paymentTime")]
        public System.DateTime paymentTime { get; set; }

        /// <summary>
        /// 支付状态（0、未支付；1、已支付）	
        /// </summary>
        [SugarColumn(ColumnName = "payStatus")]
        public System.Int32 payStatus { get; set; }

        /// <summary>
        /// 充值状态（0、失败；1、成功,2、已退款）
        /// </summary>
        [SugarColumn(ColumnName = "status")]
        public System.Int32 status { get; set; }
    }
}